#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char *argv[])
{
	if(argc >= 3){
		if(argv[1][1] == 't'){
			int time = 0;
			if(argv[2])
				time = atoi(argv[2]);
			cout<<"The system will lock after "<<time<<" (s)."<<endl
			<<"Don't kill this window.Waiting..."<<endl;
			_sleep(time*1000);
			cout<<"Sleepping..."<<endl;
			system("rundll32 user32.dll,LockWorkStation");
		}else{
			cout<<"Syntax Error"<<endl;
		}
	}else{
		system("rundll32 user32.dll,LockWorkStation");
	}
	return 0;
}